#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<assert.h>
int my_strncmp(const char* arr1, const char* arr2, size_t num)
{
	assert(arr1 && arr2);
	for (int i = 0; i < num; i++) {
		if (*(arr1 + i) == *(arr2 + i));
		else if (*(arr1 + i) > *(arr2 + i)) return 1;
		else return -1;
	}
	return 0;
}
int main()
{
	char arr1[] = "abcdefg";
	char arr2[] = "abcdfea";
	int ret = my_strncmp(arr1, arr2, 4);
	printf("%d\n", ret);
	ret = my_strncmp(arr1, arr2, 5);
	printf("%d\n", ret);
	return 0;
}